#ifndef __CONFIGURATION_H__
#define __CONFIGURATION_H__

#include "MutexLock.hpp"

#include <string>
#include <map>

using std::string;
using std::map;

namespace cdm{

class Configuration{

public:
    class AutoRelase{
    public:
        AutoRelase(){}
        ~AutoRelase(){
            if(_conf){
                delete _conf;
                _conf = nullptr;
            }
        }
    };

public:

    static Configuration* getConfiguration(const string &path);
    static void destroyCon();
    
    map<string,string> getInfo(){
        return _info;
    }


private:

    Configuration(const string &path);
    ~Configuration(){}
    /* void readInfo(); */

private:
    map<string,string>      _info;
    static Configuration*   _conf;
    static AutoRelase       _au;
    MutexLock               _mutex;

};


}//end of cdm

#endif


